package com.tkc.converter;

import java.util.ArrayList;
import java.util.List;

import com.tkc.controller.model.vo.TeacherVO;
import com.tkc.service.model.info.TeacherInfo;

/**
 * 
 * @Function: 用于service层到controller层对象数据的转换
 * 
 * @Project :assessmenttask 
 * @Package :com.tkc.converter 
 * @File :InfoConvertToVO.java 
 * @ClassName: InfoConvertToVO  
 * 
 * @author tankaichao 
 * @email cgztkc@126.com 
 * @Date 2016年8月9日下午6:10:59
 * @since JDK 1.8 
 *
 */
public class InfoConvertToVO {
	
	public static TeacherVO convertFromTeacherInfoToTeacherVO(TeacherInfo teacherInfo) {
		TeacherVO teacherVO = new TeacherVO();
		teacherVO.setId(teacherInfo.getId());
		teacherVO.setName(teacherInfo.getName());
		teacherVO.setPassword(teacherInfo.getPassword());
		teacherVO.setSex(teacherInfo.getSex());
		teacherVO.setDesc(teacherInfo.getDesc());
		teacherVO.setPicUrl(teacherInfo.getPicUrl());
		teacherVO.setSchoolName(teacherInfo.getSchoolName());
		teacherVO.setRegistDate(teacherInfo.getRegistDate());
		teacherVO.setRemark(teacherInfo.getRemark());
		return teacherVO;
	}
	
	public static List<TeacherVO> convertFromTeacherInfosToTeacherVOs(List<TeacherInfo> teacherInfos) {
		List<TeacherVO> teacherVOs = new ArrayList<TeacherVO>();
		for (TeacherInfo teacherInfo : teacherInfos) {
			TeacherVO teacherVO = InfoConvertToVO.convertFromTeacherInfoToTeacherVO(teacherInfo);
			teacherVOs.add(teacherVO);
		}
		return teacherVOs;
	}

	
}
